import { useRouter, type RouteLocationPathRaw } from 'vue-router';
import { useKeepLiveStore } from '../stores/keepLive';

export interface UseThRouterOpts extends RouteLocationPathRaw {
  caches?: string[]
}

export function useThRouter(opts?: UseThRouterOpts) {
  const { cache: keepAliveCache } = useKeepLiveStore()
  const router = useRouter()
  const caches = opts?.caches

  function thPush() {
    if (caches) keepAliveCache.keepAliveViews.push(...caches)
    
    router.push({

    })
  }
}